#!/usr/bin/bash
sendkey=6fa09b8765ea24403ecea533d18eee3aa7a33662625d81d1369113b132900ba9
 # 发送的信息内容 可以通过zabbix在里面定义消息模版去实现
 # 标题其实也是可以定义消息模版去实现的
#a=SEC2d163a6ebe35bf190d6e1f11342d1b01d68fcb54cdfb00c79fec246b3ed1cb67
# https://oapi.dingtalk.com/robot/send?access_token=6fa09b8765ea24403ecea533d18eee3aa7a33662625d81d1369113b132900ba9
curl 'https://oapi.dingtalk.com/robot/send?access_token='$sendkey \
-H 'Content-Type: application/json' \
-d "
{
        \"actionCard\": {
        \"title\": \"$1\",
        \"text\": \"$2\",
        \"hideAvatar\": \"0\",
        \"btnOrientation\": \"0\",
        \"btns\": [
        {
            \"title\": \" 请尽快处理\"
        }
     ]
   },
   \"msgtype\": \"actionCard\"
}"

# 执行方法： chmod +x dingding \
            ./dingding 标题(在钉钉群机器人上自定义的关键词) 告警的具体内容